-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow gatewayProvisioner to create contour that only watch limited na… #6073
Allow gatewayProvisioner to create contour that only watch limited na… #6073
Conversation
a237ddf
to
45b732e
Compare
How do I set the label of release-note? |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #6073 +/- ##
==========================================
- Coverage 78.82% 78.52% -0.31%
==========================================
Files 138 140 +2
Lines 19766 19911 +145
==========================================
+ Hits 15581 15635 +54
- Misses 3878 3967 +89
- Partials 307 309 +2
|
d205e85
to
a52c282
Compare
@lubronzhan the other thing we want to do here is generate per-namespace Roles/RoleBindings for Contour, instead of the default ClusterRole/ClusterRoleBinding, since the user typically wants/should want least privileges when restricting to 1+ specific namespace(s). Effectively doing the same as what's in https://github.com/projectcontour/contour/blob/main/examples/namespaced/kustomization.yaml. The code for the provisioner generating RBAC resources is in https://github.com/projectcontour/contour/tree/main/internal/provisioner/objects/rbac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll definitely want an E2E test on this, to ensure we got all the RBAC right. See https://github.com/projectcontour/contour/blob/main/test/e2e/provisioner/provisioner_test.go for existing provisioner tests that instantiate a Contour and test traffic routing.
Ohk, I thought just doing the kustomization is enough, for example I added an example here. https://github.com/lubronzhan/contour/blob/topic/lubron/fix-5256/examples/namespaced-gatewayapi/kustomization.yaml Do we have e2e test for the kustomization as well? or we just manually test it |
0860e61
to
16d413d
Compare
50fe842
to
9b95033
Compare
34281ac
to
189131c
Compare
Ok the code-gene difference is
Turns out I need to rebase |
c2b8cb2
to
5ae1c67
Compare
Signed-off-by: lubronzhan <lubronzhan@gmail.com> Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
df62c3e
to
3fb1e9c
Compare
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
5746d35
to
d7a63b1
Compare
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
d7a63b1
to
c8666ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is pretty much good to go minus some small things, one thing I would maybe change too is to put the new API Namespace type in the v1
package so we can use it in that package later as well, better to have a type there and use it in v1alpha
than the other way round I think (and not have to define it twice)
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
f1fd602
to
ca7c2cd
Compare
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple more tiny spelling nits, otherwise I think this is about good to go as well
Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
Thanks! |
Signed-off-by: lubronzhan <lubronzhan@gmail.com>
@lubronzhan LGTM thx |
…mespaces of resources
Fix #5256
Based on change of @padlar here
Previous PR didn't take care of the case of GatewayProvisioner. Since gatewayProvisioner has its own manager, and gatewayClass is a clusterscope variable
Now, if customer set
spec.contour.watchNamespaces
in ContourDeployment, the contour instance created by gatewayProvisioner will only watch namespaces underspec.contour.watchNamespaces
and the resources under the namespace where the contour instance is located.I have one concern is, if customer doesn't include ContourDeployment's namespace in watchNamespace, do we automatically add it to the Contour's watchNamespace, or we put condition inside Gateway to show that this is an issue, that they should include the namespace in the watchNamespace. Open to ideas about whether to choose 1st or 2nd option